/**
 * Copyright (c) 2008 Luciano Bustos - riaevolution.com, All Rights Reserved.
 *
 * Contact luchyx@riaevolution.com
 * See www.riaevolution.com
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * */
package com.riaevolution.components {
	import mx.controls.ToolTip;

	/**
	 * Add support for HTML inside the tooltip.
	 * SUPPORTED TAGS:
	 * <ul>
	 * <li>Anchor tag (&lt;a&gt;)
	 * <li>Bold tag (&lt;b&gt;)
	 * <li>Break tag (&lt;br&gt;)
	 * <li>Font tag (&lt;font&gt;)
	 * <li>Image tag (&lt;img&gt;)
	 * <li>Italic tag (&lt;i&gt;)
	 * <li>List item tag (&lt;li&gt;)
	 * <li>Paragraph tag (&lt;p&gt;)
	 * <li>Text format tag (&lt;textformat&gt;)
	 * <li>Underline tag (&lt;u&gt;)
	 * </ul>
	 * <br/>
	 * <br/>
	 * You must replace the toolTip Default Class.<br/>
	 * <listing>
	 * 	ToolTipManager.toolTipClass = com.riaevolution.components.HTMLTooltip;
	 * </listing>
	 *
	 *
	 * <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=textcontrols_060_10.html">See more of supported tags here.</a>
	 * <br /><br />
	 * <br /><b>Luciano bustos</b> <a href="mailto:luchyx&#64;riaevolution.com">luchyx&#64;riaevolution.com</a><br /><a href="http://www.riaevolution.com">www.riaevolution.com</a>
	 *
	 */
	public class HTMLTooltip extends ToolTip {

		/**
		 *  You must replace the toolTip Default Class.
		 * <listing>
		 * 	ToolTipManager.toolTipClass = com.riaevolution.components.HTMLTooltip;
		 * </listing>
		 * To see in action you can do:
		 * 
		 * <listing>
		 * myButton.toolTip = "&lt;b&gt;this text is bold&lt;/b&gt; but this not and there is a &lt;br /&gt; new line";
		 * </listing>
		 *
		 */
		public function HTMLTooltip() {
			super();
		}

		/**
		 * override the default behaviour and do the magic!.
		 *
		 */
		override protected function commitProperties():void {
			super.commitProperties();
			textField.htmlText = text;
		}
	}
}